<?php if (!defined('THINK_PATH')) exit();?><!doctype>
<html>
	<head>
		<title>修改密码</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
		<link rel="stylesheet" href="/Public/gold/rem_zy/css/style.css">
		<link rel="stylesheet" href="/Public/gold/rem_zy/css/userCenter.css">
		<link rel="stylesheet" type="text/css" href="/Public/gold/css/public.css"/>
		<script src="/Public/gold/rem_zy/js/jquery.min.js"></script>

		<script src="/Public/layer/layer.js"></script>
		<script type="text/javascript" src="/Public/gold/rem_zy/js/index.js"></script>
		<script type="text/javascript" src="/Public/assets/js/jquery.form.js"></script>

		<script>
            $(function() {

                $('#memberUpdatePwd').ajaxForm({
                    beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
                    success: complete, // 这是提交后的方法
                    dataType: 'json'
                });

                function checkForm(){

                    if( '' == $.trim($('#rePwd').val())){
                        layer.alert('原密码不能为空', {icon: 6}, function(index){
                            layer.close(index);
                            $('#rePwd').focus();
                        });
                        return false;
                    }

                    if( '' == $.trim($('#newPwd').val())){
                        layer.alert('新密码不能为空', {icon: 6}, function(index){
                            layer.close(index);
                            $('#newPwd').focus();
                        });
                        return false;
                    }

                    if( '' == $.trim($('#newPwdRe').val())){
                        layer.alert('确认密码不能为空', {icon: 6}, function(index){
                            layer.close(index);
                            $('#newPwdRe').focus();
                        });
                        return false;
                    }

                    if('' != $.trim($('#newPwd').val()) && '' != $.trim($('#newPwdRe').val())){

                        if($.trim($('#newPwd').val()) != $.trim($('#newPwdRe').val())){
                            layer.alert('新密码与确认密码输入的不同', {icon: 6}, function(index){
                                layer.close(index);
                            });
                            return false;
						}

					}



				}

                function complete(data){
                    if(data.status==1){
                        layer.alert(data.info, {icon: 6}, function(index){
                            layer.close(index);
                            window.location.href=data.url;
                        });
                    }else{
                        layer.alert(data.info, {icon: 6}, function(index){
                            layer.close(index);
                        });
                        return false;
                    }
                }

            })
		</script>
	</head>
	<body>
		<div id="head">
			<p class="title l">淘金果园</p>
			<ul class="user r">
				<li class="l">
					<img src="/Public/gold/rem_zy/images/userCenter/yonghuzhongxin.png">
				</li>
				<li class="l">
					<a href="<?php echo U('Farm/index');?>">
						<img src="/Public/gold/rem_zy/images/userCenter/tuichu.png">
					</a>
				</li>
			</ul>
		</div>
		<div id="banner">
			
		</div>
		<ul id="list">
			<li class="keng"><span>+</span> 用户中心</li>
			<li class="zhouyun">
				<ul>
					<li><a href="userCenter.html">账户概要</a></li>
					<li><a href="<?php echo U('Member/memberSafeCenter');?>" style="color:#f4771c;">安全设置</a></li>
					<li><a href="userCenter_fruit.html">果园钱包</a></li>
					<li><a href="userCenter_zhanghu.html">账户充值</a></li>
					<li><a href="userCenter_jinbi.html">金币提现</a></li>
					<li><a href="userCenter_coinDetails.html">金币充值</a></li>
				</ul>
			</li>
			<li class="keng"><span>+</span> 农贸市场</li>
			<li class="zhouyun">
				<ul>
					<li><a href="market_weituogl.html">委托管理</a></li>
					<li><a href="market_jiaoyijl.html">交易记录</a></li>
					<li><a href="market_fruitReLive.html">果实重生</a></li>
					<li><a href="market_reLiveList.html">重生记录</a></li>
					<li><a href="market_fruitGiving.html">果实赠送</a></li>
					<li><a href="market_givingList.html">赠送记录</a></li>
				</ul>
			</li>
			<li class="keng"><span>+</span> 推广中心</li>
			<li class="zhouyun">
				<ul>
					<li><a href="extensionCenter_link.html">推广链接</a></li>
					<li><a href="extensionCenter_list.html">推广列表</a></li>
					<li><a href="extensionCenter_reward.html">推广奖励</a></li>
					<li><a href="extensionCenter_code.html">补推广码</a></li>
					<li><a href="extensionCenter_contact.html">联系资料</a></li>
					<li><a href="extensionCenter_teacher.html">我的导师</a></li>
				</ul>
			</li>
		</ul>
		<form method="post" id="memberUpdatePwd" action="<?php echo U('memberUpdatePwd');?>">
		<div id="changeThings">
			<h1 class="guanli">修改登录密码</h1>
			
			<div class="iptStyle">
				<span class="allType l">原密码</span>
				<input type="password" name="rePwd" id="rePwd" class="iptTwo" placeholder="请输入原密码">
			</div>
			<div class="iptStyle">
				<span class="allType l">新密码</span>
				<input type="password" name="newPwd" id="newPwd" class="iptTwo" placeholder="请输入新密码">
			</div>
			<div class="iptStyle">
				<span class="allType l">确认新密码</span>
				<input type="password" name="newPwdRe" id="newPwdRe" class="iptTwo" placeholder="请再次输入新密码">
			</div>
			
			<button>提交</button>
			
			
			<div style="width: 100%, height:1rem"></div>
		</div>
		</form>
	</body>	
</html>